﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="MemberList.aspx.vb" Inherits="FishTank.MemberList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1>Our Members</h1>
       
    <div class="search">
        Search by 
        <asp:DropDownList ID="SearchType" runat="server">
            <asp:ListItem Value="UserName">Username</asp:ListItem>
            <asp:ListItem Value="FirstName">First Name</asp:ListItem>
            <asp:ListItem Value="LastName">Last Name</asp:ListItem>
        </asp:DropDownList>
        <asp:TextBox ID="SearchBox" runat="server" AutoPostBack="True"></asp:TextBox>
        <asp:Button ID="SearchButton" runat="server" Text="Go" />
        <asp:Button ID="ResetButton" runat="server" Text="Reset" />
    </div>

    <p>
    <asp:GridView ID="ListGrid" runat="server"
        AutoGenerateColumns="False" AllowSorting="True" Width="100%"
        CssClass="gridView">

        <AlternatingRowStyle CssClass="gridAltRowView" />

        <EmptyDataTemplate>
        <p>Your search did not match any members.</p>
        </EmptyDataTemplate>
        
        <Columns>
            <asp:TemplateField HeaderText="Photo">
                <ItemTemplate>  
                    <a type="application/rss+xml" href="~/Pages/MemberDetail.aspx?UserName=<%# Eval("UserName") %>">
                        <asp:Image ID="profilePhoto" runat="server"
                                   ImageUrl='<%# getPhotoPath(Eval("Photo")) %>' AlternateText="<%# Bind('UserName') %>"/>
                    </a>
                </ItemTemplate>
                <ItemStyle Width="64" Height="64" />
            </asp:TemplateField>
            <asp:HyperLinkField DataNavigateUrlFields="UserName" 
                DataNavigateUrlFormatString="~/Pages/MemberDetail.aspx?UserName={0}" DataTextField="UserName" 
                HeaderText="Username" SortExpression="UserName" />
            <asp:BoundField DataField="FirstName" HeaderText="First Name" SortExpression="FirstName" />
            <asp:BoundField DataField="LastName" HeaderText="Last Name" SortExpression="LastName" />
         
        </Columns>
    </asp:GridView>
</p>
</asp:Content>
